﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>ResxAttachedFilesFolder</title>
</head>
<body>
<div class="easyui-layout" data-options="fit:true,">
    <div data-options="region:'west',split:true,title:'用户导航'," style="padding: 1px; width: 168px; height: 100%;">
        <table id="treeview2" class="easyui-tree" data-options="title:'节点列表',method:'POST',lines:true,animate:true,dnd:true,fix:true," style="height: 100%;"></table>
    </div>
    <div data-options="region:'center'," style="padding: 1px;">
        <div class="easyui-layout" data-options="fit:true,">
            <div data-options="region:'north',split:false,border:false," class="nowrap" style="height: 27px; overflow: hidden;">
                <div style="float: left;">
                    <a href="javascript:void(0)" class="easyui-linkbutton mp0" id="nodeNew" data-options="iconCls:'icon-add1',plain:true,"></a>
                    <a href="#" class="easyui-menubutton" data-options="menu:'#mm2',iconCls:'icon-edit',"></a>
                    <div id="mm2" style="width: 150px;">
                        <div id="nodeEdit">编辑（双击）</div>
                        <div data-options="iconCls:'icon-cancel'">删除</div>
                        <div data-options="iconCls:'icon-stop'">停止</div>
                        <div class="menu-sep"></div>
                        <div id="sortYes">可排序</div>
                        <div id="sortSave">保存排序</div>
                        <div class="menu-sep"></div>
                        <div data-options="disabled:true,">全选</div>
                        <div data-options="disabled:true,">反选</div>
                        <div data-options="disabled:true,">不选</div>
                    </div>
                </div>
                <div style="float: right; padding: 2px 1px 0px 2px;">
                    <input class="easyui-searchbox" data-options="prompt:'',menu:'#mmx',searcher:window.xbase.doSearch," style="width: 100px;" />
                    <div id="mmx" style="display: none;">
                        <div data-options="name:'node',plain:true,">节点</div>
                        <div data-options="name:'info',plain:true,">内容</div>
                    </div>
                </div>
            </div>
            <div data-options="region:'center',border:true," style="padding: 1px;">
                <table id="datagrid2" class="easyui-datagrid" style="width: 100%; height: 100%; overflow: auto;" data-options="title:'新闻内容列表',iconCls:'icon-group',rownumbers:true,pagination:true,singleSelect:true,
                method:'post',autoRowHeight:true,toolbar:'#tbs',onLoadSuccess:function(){$(this).datagrid('enableDnd');},">
                    <thead>
                        <tr>
                            <th data-options="field:'ck',checkbox:true,"></th>
                            <th data-options="field:'PkId',halign:'center',">ID</th>
                            <th data-options="field:'Title',halign:'center',">标题</th>
                            <th data-options="field:'Folder',halign:'center',">访问文件夹</th>
                            <th data-options="field:'DateTimeCreate',halign:'center',formatter:window.xbase.FormatDateTime,">时间</th>
                            <th data-options="field:'FlagStatus',halign:'center',formatter:window.xbase.FormatSaleFlagStatus,">状态</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        window.xbase.logonNo(); // 访问本页面，如已登录则跳转到index.html。
        $('#treeview2').tree({ url: '/Ashx/Acc/Staff/ResxAttachedFolder.ashx?' + window.xbase.urlparas });
        $('#datagrid2').datagrid({ url: '/Ashx/Acc/Staff/ResxAttachedList.ashx?' + window.xbase.urlparas });
        $('#datagrid2').datagrid({
            onDblClickRow: function (index, field, value) {
                $('#Action').attr('value', 'ActNew');
                $('#datagrid2').datagrid('clearSelections'); //清除所有
                $('#datagrid2').datagrid('selectRow', index); //选择当前
                $('#dialog1').dialog({
                    title: '内容选择',
                    method: 'get',
                    closed: false,
                    cache: false,
                    href: '/Html/Acc/Staff/NewsAdminGroupInfoForm.html?' + window.xbase.urlparas,
                    modal: true,
                    success: function (result) {
                        alert(result);
                    }
                });
            },
        });
        $('#nodeNew').click(function () {
            if (!window.xbase.checkTreeViewNode('#treeview2')) return;
            $('#Action').attr('value', 'ActNew');
            $('#dialog1').dialog({
                title: '内容选择',
                method: 'get',
                closed: false,
                cache: false,
                href: '/Html/Acc/Staff/NewsAdminGroupInfoForm.html?' + window.xbase.urlparas,
                modal: true,
                success: function (result) {
                    alert(result);
                }
            });
        });
        $('#treeview2').tree({
            onClick: function (node) {
                var opts = $('#datagrid2').datagrid('getPager').data("pagination").options;
                var q = '';
                q += window.xbase.getQuery(q, 'id', node.attributes.value);
                q += window.xbase.getQuery(q, 'page', opts.pageNumber);
                q += window.xbase.getQuery(q, 'rows', opts.pageSize);
                q += window.xbase.getQuery(q, 'rnd', Math.random());
                q = q != '' ? '?' + q : '';
                $('#datagrid2').datagrid({
                    url: '/Ashx/Acc/Staff/NewsAdminGroupInfoListLower.ashx' + q,
                    success: function (result) {
                        $.messager.alert('Access', result, 'info');
                    },
                });
            }
        });
    });
</script>
</body>
</html>
